/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.dew.discoteca.controller;

import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import pe.edu.upc.dew.discoteca.model.Persona;

/**
 *
 * @author elvis
 */
@Controller
public class UsuariosController {

    @RequestMapping( method = RequestMethod.GET)
    public String intro(ModelMap model ,HttpServletRequest req){
        model.addAttribute(new Persona());
        return "usuarios/registrar";
    }

    @RequestMapping( method = RequestMethod.POST)
    public String registrar( Persona persona, ModelMap model ,HttpServletRequest req){
        System.out.println(persona.toString());
        model.addAttribute(persona);
        return "usuarios/confirmar";
    }
}